import { http } from './http';
import { ownHttp } from './ownHttp';
import { secret } from '@/js/global';
import { userName } from './comPathName';

/**
 * @use 用户登录
 */
export const loginApi = (data) => {
  return http.post('/api/general/userlogin', data);
};

/**
 * @use 获取所有设备接口
 */
export const getEquipListApi = () => {
  return http.get(`/api/general/alldeviceinfo?secret=${secret}`);
};

/**
 * @use 获取所有音乐列表接口
 */
export const getMusicListApi = () => {
  return http.get(`/api/general/servermusicinfo?secret=${secret}`);
};

/**
 * @use 获取按钮布局接口
 */

export const getisBtnTopApi = () => {
  return ownHttp.get(`/user/${localStorage.getItem('username')}/layout/layoutConfig.info`);
};

/**
 * @use 获取播放接口
 */
export const getPlayMusicAip = (data) => {
  return http.post(`/api/general/playmusicbylist`, data);
};

/*
 * @use 获取音量接口
 */
export const getChangeVolumeAip = (data) => {
  return http.post(`/api/general/setvol`, data);
};

/*
 * @use 停止接口
 */
export const getStopTaskApi = (data) => {
  return http.post(`/api/general/stoparea`, data);
};

/**
 * @use 定时器立即执行接口
 */
export const actionNowApi = () => {
  return http.post(`/api/general/executetimerscheme?secret=${secret}`);
};

/**
 *@use 复制定时点方案
 */
export const copyOwnTimeApi = (data) => {
  return ownHttp.post(`/api/general/copytimerscheme`, data);
};

/**
 * @use 监听接口
 */
export const monOutApi = (data) => {
  return http.post(`/api/general/usermonitor`, data);
};
